package com.example.libraryapp.util;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.libraryapp.R;

public class GlideUtil {

    public static void loadImage(Context context, String url, ImageView imageView) {
        RequestOptions requestOptions = new RequestOptions()
                .placeholder(new ColorDrawable(Color.BLUE))
                .error(R.drawable.ic_picture_error);

        Glide.with(context).load(url)
                .apply(requestOptions)
                .into(imageView);
    }

}
